the program's execution, and is deallocated upon the program's termination. As
mentioned earlier, this variable may be accessed from within other source files provided these source files redeclare the variable. Since space for the variable must be allocated only once, the declaration in one and only one of the source files should also serve as a definition for the variable. This is accomplished in one of two ways in ANSI C. (1) The (sole) definition is of the form 'int id_number' and the declarations in other files are of the form 'extern int id_number'. (2) The (sole) definition involves an initialization as 'extern int id_number = 0' and the declarations in other files are of the form 'extern int id_number'. Only (1) is supported by Think C v. 4.0.
Although function definitions do not allocate space as variable definitions do, a distinction is still made between the function definition and a declaration of this entity. Functions are defined in a single source file, and the function "prototype" is used to declare the function for access in other source files*.
Since the "definition" of a user-defined data type includes declarations needed by the compiler, it must be included in every source file using the data type. As mentioned earlier, header files are usually used to avoid repetition**.